Create a codemod to replace Datagrid by DataTable #10762
Conversation
…atagrid component by & .RaDataTable-xxxx
|
It would be great if this handled Also, |
|
Hi @dalen
|
|
@dalen on second look I realize that supporting |
Problem
We have too many
Datagridthat we want to transform toDataTableto do it manuallySolution
Create a codemod to do it automatically
How To Test
test.tsxand fill it with the example you want to transform. e.g.: the following onenpx jscodeshift test.tsx \ --extensions=ts,tsx \ --parser=tsx \ --transform=./packages/ra-core/codemods/replace-Datagrid-DataTable.tsTo Do
Datagridcomponent<DataTable.Col source="xxx">Datagridpropsoptimizedprop of theDatagridcomponentrowStyleprop of theDatagridcomponent byrowSx& .RaDatagrid-xxxxkey of thesxprop of theDatagridcomponent by& .RaDataTable-xxxxTextField(with onlysource,labeland/orempty)NumberField(with onlysource,label,empty,optionand/orlocal)Additional Checks
masterfor a bugfix or a documentation fix, ornextfor a feature